package com.taobao.tools;

import org.eclipse.swt.widgets.Display;

import com.taobao.pojo.Config;

public class ClearMessageThread extends Thread {

	private Display display;

	private Long messageId;

	public ClearMessageThread(Display display, Long messageId) {
		this.display = display;
		this.messageId = messageId;
	}

	@Override
	public void run() {
		final TBStatusLineManager tbStatusLineManager = Config.tbStatusLineManager;
		try {
			Thread.sleep(5000);
			display.asyncExec(new Runnable() {
				public void run() {
					if (messageId == tbStatusLineManager.getMessageId()) {
						tbStatusLineManager.clearMessage();
					}
				}
			});
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
